<template>

  <a-row :gutter="10">
    <a-col :md="24" :sm="24">
      <a-card title="机构信息">
        <a-form>
          <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="openSeachStock" label="机构编码">
            {{loginOrg.orgCode}}
          </a-form-item>
          <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="openSeachStock" label="机构名称">
            {{loginOrg.departName}}
          </a-form-item>
        </a-form>
        <a-card :bordered="false" size="small" :tabList="tabList" :activeTabKey="activeTabKey" @tabChange="
          (key) => {
            this.activeTabKey = key
          }
        ">
          <DepartMerchantSetting ref="DepartMerchantSetting" v-if="activeTabKey === '1'"></DepartMerchantSetting>
          <ProductMerchantSetting ref="ProductMerchantSetting" v-if="activeTabKey === '2'"></ProductMerchantSetting>
        </a-card>
      </a-card>
    </a-col>
  </a-row>
</template>
<script>
import { postAction } from '@/api/manage'
import DepartMerchantSetting from './modules/DepartMerchantSetting'
import ProductMerchantSetting from './modules/ProductMerchantSetting'
export default {
  name: 'DepartMerchant',
  components: {
    DepartMerchantSetting,
    ProductMerchantSetting,
  },
  data() {
    return {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 10 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 14 },
      },
      loginOrg:{
        id: 0,
      },
      tabList: [
        {
          key: '1',
          tab: '库存设置',
        },
        {
          key: '2',
          tab: '货品设置',
        },
      ],
      activeTabKey: '1',
      url: {
          queryLoginOrg: '/sys/sysDepart/getMyLoginTopDepart'
      },
    }
  },
  computed: {

  },
  methods: {
    queryLoginOrg(){
      postAction(this.url.queryLoginOrg,{}).then(res=>{
        if(res.success){
          this.loginOrg = res.result
        }else{
          this.$message.warning(res.message)
        }
      })
    },
  },
  created() {
    this.queryLoginOrg()
  },
}
</script>
<style scoped>
</style>